package com.szqhyxj.youxiangju.biz.card.credit;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.KeyEvent;
import android.widget.TextView;

import com.szqhyxj.youxiangju.BaseActivity;
import com.szqhyxj.youxiangju.R;
import com.szqhyxj.youxiangju.biz.card.CardActivity;
import com.szqhyxj.youxiangju.sys.components.NavigationBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class RelieveCreaditOkActivity extends AppCompatActivity implements NavigationBar.NavigationBarListener{

    public static String INTENT_TYPE = "RelieveCreaditOkActivity";
    private static final String MSG = "msg";
    @BindView(R.id.navigationBar)
    NavigationBar navigationBar;
    @BindView(R.id.achieve)
    TextView achieve;

    public static void start(BaseActivity activity, String msg){
        Intent intent = new Intent();
        intent.putExtra(msg, msg);
        intent.setClass(activity, RelieveCreaditOkActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_relieve_creadit_ok);
        ButterKnife.bind(this);
        String msg = getIntent().getStringExtra(MSG);

        navigationBar.setNavigationBarListener(this);
    }

    @OnClick(R.id.achieve)
    public void onViewClicked(){
        CardActivity.start(this);
    }

    @Override
    public void navigationLeft(){
        CardActivity.start(this);
    }

    @Override
    public void navigationRight(){
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode==KeyEvent.KEYCODE_BACK){
            CardActivity.start(this);
        }
        return super.onKeyDown(keyCode, event);
    }
}
